export const getTreeData = parentKey => {
  const level = (parentKey ? parentKey.split('-').length : 0) + 1;
  if (level > 3) return [];
  const lengthMap = {
    1: 300,
    2: 3000,
    3: 1000
  };
  return new Array(lengthMap[level]).fill(0).map((item, index) => ({
    title: `item ${index}`,
    key: `${parentKey ? parentKey + '-' : ''}${index}}`,
    children: getTreeData(`${parentKey ? parentKey + '-' : ''}${index}`)
  }));
};

const list = getTreeData()

postMessage(list)